package main

import (
	"fmt"
	"math"
	"time"
)

const n = 2000000

func main () {
	start := time.Now()
	i := 2
	var sum uint64 = 0
	for i < n {
		if isPrime(i) {
			sum = sum + uint64(i)
		}
		i++
	}
	fmt.Println("sum = ", sum)
	stop := time.Now()
	fmt.Println("Execution time:", stop.Sub(start))

}

func isPrime(a int) bool {
	n := int(math.Sqrt(float64(a)))
	for i := 2; i < n; i++ {
		if a % i == 0 {
			return false
		}
	}
	return true
}
